obj_path = .\obj
rm_o = del

drv_obj:xdisk.c driver.c main.c
	gcc -c xdisk.c -o $(obj_path)\xdisk.o
	gcc -c driver.c -o $(obj_path)\driver.o
	gcc -c xfat.c -o $(obj_path)\xfat.o
	gcc -c main.c -o $(obj_path)\main.o

main:$(obj_path)\xdisk.o $(obj_path)\driver.o $(obj_path)\xfat.o $(obj_path)\main.o
	gcc $^ -o $@.exe

$(obj_path)\xdisk.o:xdisk.c
	gcc -c xdisk.c -o $(obj_path)\xdisk.o

$(obj_path)\driver.o:driver.c
	gcc -c driver.c -o $(obj_path)\driver.o

$(obj_path)\xfat.o:xfat.c
	gcc -c xfat.c -o $(obj_path)\xfat.o

$(obj_path)\main.o:main.c
	gcc -c main.c -o $(obj_path)\main.o

clean_obj:
	$(rm_o) $(obj_path)\*.o

clean_main:
	$(rm_o) main.exe

clean_all:
	$(rm_o) $(obj_path)\*.o
	$(rm_o) main.exe
